/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package games.mapacman.server;

import java.awt.Dimension;
import java.awt.Point;
import java.awt.Rectangle;
import java.io.IOException;
import marauroa.common.net.InputSerializer;
import marauroa.common.net.OutputSerializer;
import marauroa.common.net.Serializable;

/**
 *
 * @author mehadihasan
 */
class ZoneBox extends Rectangle{

    String ip = "";
    private int population=0;
    public ZoneBox left, right, top, bottom;

    public ZoneBox(Point point, Dimension dmnsn) {
        super(point, dmnsn);
        left = right = bottom = top = null;
    }

    public ZoneBox(int x, int y, int width, int height) {
        super(x, y, width, height);
        left = right = bottom = top = null;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public int getPopulation() {
        return population;
    }

    public void incrementPopulation() {
        this.population++;
    }

    public void setPopulation(int population) {
        this.population = population;
    }

    public ZoneBox getBottom() {
        return bottom;
    }

    public void setBottom(ZoneBox bottom) {
        this.bottom = bottom;
    }

    public ZoneBox getLeft() {
        return left;
    }

    public void setLeft(ZoneBox left) {
        this.left = left;
    }

    public ZoneBox getRight() {
        return right;
    }

    public void setRight(ZoneBox right) {
        this.right = right;
    }

    public ZoneBox getTop() {
        return top;
    }

    public void setTop(ZoneBox top) {
        this.top = top;
    }

    
    
    public boolean equals(Rectangle r) {
        if (this.getX() == r.getX()
                && this.getY() == r.getY()
                && this.getWidth() == r.getWidth()
                && this.getHeight() == r.getHeight()) {
            return true;
        }
        return false;
    }

    @Override
    public String toString(){
       return new String(ip+" "+ population +" "+x+" "+ y +" "+width +" "+height);
    }
    
}
